Only unref the pixbuf if the image has the appropriate storage type.
authorMatthias Clasen <mclasen@redhat.com>
Thu, 18 May 2006 16:50:49 +0000 (16:50 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 18 May 2006 16:50:49 +0000 (16:50 +0000)
2006-05-18  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkimage.c (icon_theme_changed): Only unref the pixbuf
if the image has the appropriate storage type.  (#342096, Tommi
Komulainen)

ChangeLog
ChangeLog.pre-2-10
gtk/gtkimage.c

index 4bc2c760741a0f2aeed570df5a769a29e5faa95b..e82e1bd1186a29980a6d93ecaa9ab6f7b5d78815 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-05-18  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkimage.c (icon_theme_changed): Only unref the pixbuf
+       if the image has the appropriate storage type.  (#342096, Tommi
+       Komulainen)
+
        * configure.in: Actually require GLib 2.11
        
        * gtk/gtkentry.c (gtk_entry_drag_data_received): Make drops
index 4bc2c760741a0f2aeed570df5a769a29e5faa95b..e82e1bd1186a29980a6d93ecaa9ab6f7b5d78815 100644 (file)
@@ -1,5 +1,9 @@
 2006-05-18  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkimage.c (icon_theme_changed): Only unref the pixbuf
+       if the image has the appropriate storage type.  (#342096, Tommi
+       Komulainen)
+
        * configure.in: Actually require GLib 2.11
        
        * gtk/gtkentry.c (gtk_entry_drag_data_received): Make drops
index d9a85ea2bd0fc215ed270945860bb48bda32152e..6e5509e9afb3c29b497da5af7c641562620ab0c3 100644 (file)
@@ -1383,11 +1383,14 @@ animation_timeout (gpointer data)
 static void
 icon_theme_changed (GtkImage *image)
 {
-  if (image->data.name.pixbuf)
-    g_object_unref (image->data.name.pixbuf);
-  image->data.name.pixbuf = NULL;
+  if (image->storage_type == GTK_IMAGE_ICON_NAME) 
+    {
+      if (image->data.name.pixbuf)
+       g_object_unref (image->data.name.pixbuf);
+      image->data.name.pixbuf = NULL;
 
-  gtk_widget_queue_draw (GTK_WIDGET (image));
+      gtk_widget_queue_draw (GTK_WIDGET (image));
+    }
 }
 
 static void